package com.lfy.common.constant;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
 * 环境配置
 *
 * @author <a href="https://www.lvfeiy.top">吕飞扬</a>
 * @date 2023/10/21 15:14
 */
public class EnvConfigConstant {
    /**
     * 前端跨域
     */
    public static String CORS_URL ;
    /**
     * 服务端域名
     */
    public static String URL ;
    static {
        //使用配置文件
        Properties properties = new Properties();
        //通过反射加载实现类
        InputStream envProperties = EmailConstant.class.getResourceAsStream("/env.properties");
        try {
            properties.load(envProperties);
        } catch (IOException e) {
            e.printStackTrace();
        }
        for (Object o : properties.keySet()) {
            if("url".equals(o) ){
                URL = (String) properties.get(o);
            }
            if("corsUrl".equals(o)){
                CORS_URL = (String) properties.get(o);
            }
        }
    }
}
